<?php 
session_start();
$username = $_SESSION['username'];
$password = $_SESSION['password'];

$url = "http://localhost:8080/moms-diary/services/picture/galleries";

$auth = $username.":".$password;

$context = stream_context_create(array(
    'http' => array(
        'header'  => "Authorization: Basic " . base64_encode($auth)
	)
));
$data = file_get_contents($url, false, $context);
if(isset($data)) {
	echo $data;
}
